<?php
namespace app\erp\validate;
use think\Validate;
class SalePricerule extends Validate{
    protected $rule = [
        'sale_attr_price_name' => 'require',
        'market_price' => 'require|number',
        'sale_price' => 'require|number|elt:market_price',
        'api_price' => 'require|number|elt:sale_price',
        'give_score' => 'require|number',
        'view_stock' => 'require|number',
    ];
    protected $message = [
        'sale_attr_price_name.require' => '销售属性不能为空',
        'market_price.require' => '市场价不能为空',
        'market_price.number' => '市场价格式错误',
        'sale_price.require' => '销售价不能为空',
        'sale_price.number' => '销售价格式错误',
        'sale_price.elt' => '销售价格不能高于市场价格',
        'api_price.require' => '接口价不能为空,默认0',
        'api_price.number' => '销售价格式错误',
        'api_price.elt' => '接口价格不能高于销售价格',
        'give_score.require' => '赠送积分不能为空,默认0',
        'give_score.number' => '赠送积分格式错误',
        'view_stock.require' => '显示库存不能为空',
        'view_stock.number' => '显示库存格式错误',
    ];
}